﻿/****************************** Module Header ******************************\
 * Module Name:  ExMethodForTextBox.cs
 * Module Version:  1.0.0 (2012-2-1)
 * Copyright (c) AnyEB.Com (14507247@qq.com)
 * 
 * This class is used to extension webcontrol instance's method.  It supplies 
 * public static extension methods to load data or get othor control.
 * 
 * This source is subject to the GPL License.
 * See http://www.gnu.org/licenses/gpl.html.
 * All other rights reserved.
 * 
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
 * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
\***************************************************************************/

using System;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UCF.Core.Web
{
    /// <summary>
    /// 文本控件扩展类
    /// </summary>
    public static class ExMethodForTextBox
    {
        /// <summary>
        /// 设置密码框的值
        /// </summary>
        /// <param name="oMe"></param>
        /// <param name="value"></param>
        public static void SetPassword(this TextBox oMe, string value)
        {
            oMe.Page.ClientScript.RegisterStartupScript(typeof(Page), oMe.ClientID, string.Format("<script>document.getElementById(\"{0}\").value=\"{1}\";</script>", oMe.ClientID.Replace('$', '_'), value));
        }
    }
}
